\(\int \csc ^4(c+d x) (a+b \tan (c+d x)) \, dx\) [19]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [B] (verification not implemented)
   Sympy [F]
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 19, antiderivative size = 57 \[ \int \csc ^4(c+d x) (a+b \tan (c+d x)) \, dx=-\frac {a \cot (c+d x)}{d}-\frac {b \cot ^2(c+d x)}{2 d}-\frac {a \cot ^3(c+d x)}{3 d}+\frac {b \log (\tan (c+d x))}{d} \]

[Out]

-a*cot(d*x+c)/d-1/2*b*cot(d*x+c)^2/d-1/3*a*cot(d*x+c)^3/d+b*ln(tan(d*x+c))/d

Rubi [A] (verified)

Time = 0.11 (sec) , antiderivative size = 57, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 1, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.053, Rules used = {780} \[ \int \csc ^4(c+d x) (a+b \tan (c+d x)) \, dx=-\frac {a \cot ^3(c+d x)}{3 d}-\frac {a \cot (c+d x)}{d}-\frac {b \cot ^2(c+d x)}{2 d}+\frac {b \log (\tan (c+d x))}{d} \]

[In]

Int[Csc[c + d*x]^4*(a + b*Tan[c + d*x]),x]

[Out]

-((a*Cot[c + d*x])/d) - (b*Cot[c + d*x]^2)/(2*d) - (a*Cot[c + d*x]^3)/(3*d) + (b*Log[Tan[c + d*x]])/d

Rule 780

Int[((e_.)*(x_))^(m_.)*((f_.) + (g_.)*(x_))*((a_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Int[ExpandIntegrand[(e*x
)^m*(f + g*x)*(a + c*x^2)^p, x], x] /; FreeQ[{a, c, e, f, g, m}, x] && IGtQ[p, 0]

Rubi steps \begin{align*} \text {integral}& = \frac {\text {Subst}\left (\int \frac {(a+b x) \left (1+x^2\right )}{x^4} \, dx,x,\tan (c+d x)\right )}{d} \\ & = \frac {\text {Subst}\left (\int \left (\frac {a}{x^4}+\frac {b}{x^3}+\frac {a}{x^2}+\frac {b}{x}\right ) \, dx,x,\tan (c+d x)\right )}{d} \\ & = -\frac {a \cot (c+d x)}{d}-\frac {b \cot ^2(c+d x)}{2 d}-\frac {a \cot ^3(c+d x)}{3 d}+\frac {b \log (\tan (c+d x))}{d} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.03 (sec) , antiderivative size = 78, normalized size of antiderivative = 1.37 \[ \int \csc ^4(c+d x) (a+b \tan (c+d x)) \, dx=-\frac {2 a \cot (c+d x)}{3 d}-\frac {b \csc ^2(c+d x)}{2 d}-\frac {a \cot (c+d x) \csc ^2(c+d x)}{3 d}-\frac {b \log (\cos (c+d x))}{d}+\frac {b \log (\sin (c+d x))}{d} \]

[In]

Integrate[Csc[c + d*x]^4*(a + b*Tan[c + d*x]),x]

[Out]

(-2*a*Cot[c + d*x])/(3*d) - (b*Csc[c + d*x]^2)/(2*d) - (a*Cot[c + d*x]*Csc[c + d*x]^2)/(3*d) - (b*Log[Cos[c +
d*x]])/d + (b*Log[Sin[c + d*x]])/d

Maple [A] (verified)

Time = 1.96 (sec) , antiderivative size = 46, normalized size of antiderivative = 0.81

method result size
derivativedivides \(\frac {b \left (-\frac {1}{2 \sin \left (d x +c \right )^{2}}+\ln \left (\tan \left (d x +c \right )\right )\right )+a \left (-\frac {2}{3}-\frac {\left (\csc ^{2}\left (d x +c \right )\right )}{3}\right ) \cot \left (d x +c \right )}{d}\) \(46\)
default \(\frac {b \left (-\frac {1}{2 \sin \left (d x +c \right )^{2}}+\ln \left (\tan \left (d x +c \right )\right )\right )+a \left (-\frac {2}{3}-\frac {\left (\csc ^{2}\left (d x +c \right )\right )}{3}\right ) \cot \left (d x +c \right )}{d}\) \(46\)
risch \(\frac {2 b \,{\mathrm e}^{4 i \left (d x +c \right )}+4 i a \,{\mathrm e}^{2 i \left (d x +c \right )}-2 b \,{\mathrm e}^{2 i \left (d x +c \right )}-\frac {4 i a}{3}}{d \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )^{3}}+\frac {b \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}-1\right )}{d}-\frac {b \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}{d}\) \(97\)

[In]

int(csc(d*x+c)^4*(a+b*tan(d*x+c)),x,method=_RETURNVERBOSE)

[Out]

1/d*(b*(-1/2/sin(d*x+c)^2+ln(tan(d*x+c)))+a*(-2/3-1/3*csc(d*x+c)^2)*cot(d*x+c))

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 122 vs. \(2 (53) = 106\).

Time = 0.26 (sec) , antiderivative size = 122, normalized size of antiderivative = 2.14 \[ \int \csc ^4(c+d x) (a+b \tan (c+d x)) \, dx=-\frac {4 \, a \cos \left (d x + c\right )^{3} + 3 \, {\left (b \cos \left (d x + c\right )^{2} - b\right )} \log \left (\cos \left (d x + c\right )^{2}\right ) \sin \left (d x + c\right ) - 3 \, {\left (b \cos \left (d x + c\right )^{2} - b\right )} \log \left (-\frac {1}{4} \, \cos \left (d x + c\right )^{2} + \frac {1}{4}\right ) \sin \left (d x + c\right ) - 6 \, a \cos \left (d x + c\right ) - 3 \, b \sin \left (d x + c\right )}{6 \, {\left (d \cos \left (d x + c\right )^{2} - d\right )} \sin \left (d x + c\right )} \]

[In]

integrate(csc(d*x+c)^4*(a+b*tan(d*x+c)),x, algorithm="fricas")

[Out]

-1/6*(4*a*cos(d*x + c)^3 + 3*(b*cos(d*x + c)^2 - b)*log(cos(d*x + c)^2)*sin(d*x + c) - 3*(b*cos(d*x + c)^2 - b
)*log(-1/4*cos(d*x + c)^2 + 1/4)*sin(d*x + c) - 6*a*cos(d*x + c) - 3*b*sin(d*x + c))/((d*cos(d*x + c)^2 - d)*s
in(d*x + c))

Sympy [F]

\[ \int \csc ^4(c+d x) (a+b \tan (c+d x)) \, dx=\int \left (a + b \tan {\left (c + d x \right )}\right ) \csc ^{4}{\left (c + d x \right )}\, dx \]

[In]

integrate(csc(d*x+c)**4*(a+b*tan(d*x+c)),x)

[Out]

Integral((a + b*tan(c + d*x))*csc(c + d*x)**4, x)

Maxima [A] (verification not implemented)

none

Time = 0.20 (sec) , antiderivative size = 50, normalized size of antiderivative = 0.88 \[ \int \csc ^4(c+d x) (a+b \tan (c+d x)) \, dx=\frac {6 \, b \log \left (\tan \left (d x + c\right )\right ) - \frac {6 \, a \tan \left (d x + c\right )^{2} + 3 \, b \tan \left (d x + c\right ) + 2 \, a}{\tan \left (d x + c\right )^{3}}}{6 \, d} \]

[In]

integrate(csc(d*x+c)^4*(a+b*tan(d*x+c)),x, algorithm="maxima")

[Out]

1/6*(6*b*log(tan(d*x + c)) - (6*a*tan(d*x + c)^2 + 3*b*tan(d*x + c) + 2*a)/tan(d*x + c)^3)/d

Giac [A] (verification not implemented)

none

Time = 0.37 (sec) , antiderivative size = 62, normalized size of antiderivative = 1.09 \[ \int \csc ^4(c+d x) (a+b \tan (c+d x)) \, dx=\frac {6 \, b \log \left ({\left | \tan \left (d x + c\right ) \right |}\right ) - \frac {11 \, b \tan \left (d x + c\right )^{3} + 6 \, a \tan \left (d x + c\right )^{2} + 3 \, b \tan \left (d x + c\right ) + 2 \, a}{\tan \left (d x + c\right )^{3}}}{6 \, d} \]

[In]

integrate(csc(d*x+c)^4*(a+b*tan(d*x+c)),x, algorithm="giac")

[Out]

1/6*(6*b*log(abs(tan(d*x + c))) - (11*b*tan(d*x + c)^3 + 6*a*tan(d*x + c)^2 + 3*b*tan(d*x + c) + 2*a)/tan(d*x
+ c)^3)/d

Mupad [B] (verification not implemented)

Time = 4.18 (sec) , antiderivative size = 49, normalized size of antiderivative = 0.86 \[ \int \csc ^4(c+d x) (a+b \tan (c+d x)) \, dx=\frac {b\,\ln \left (\mathrm {tan}\left (c+d\,x\right )\right )}{d}-\frac {a\,{\mathrm {tan}\left (c+d\,x\right )}^2+\frac {b\,\mathrm {tan}\left (c+d\,x\right )}{2}+\frac {a}{3}}{d\,{\mathrm {tan}\left (c+d\,x\right )}^3} \]

[In]

int((a + b*tan(c + d*x))/sin(c + d*x)^4,x)

[Out]

(b*log(tan(c + d*x)))/d - (a/3 + (b*tan(c + d*x))/2 + a*tan(c + d*x)^2)/(d*tan(c + d*x)^3)